package com.studies.mycenter.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.studies.common.R.R;
import com.studies.mycenter.pojo.Activity;
import com.studies.mycenter.pojo.UndertakeOrg;
import com.studies.mycenter.service.ActivityService;
import com.studies.mycenter.service.UndertakeOrgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 研学承办机构 前端控制器
 * </p>
 *
 * @author 研学活动后台
 * @since 2019-12-24
 */
@Api(tags="活动模块")
@CrossOrigin //跨域
@RestController
@RequestMapping("/mycenter/undertake-org")
public class UndertakeOrgController {
    @Autowired
    private UndertakeOrgService undertakeOrgService;
    @ApiOperation(value = "分页承办机构列表")
    @GetMapping(value = "{page}/{limit}")
    public R selectPage(@ApiParam(name = "page", value = "当前页码", required = true)
                        @PathVariable Long page,

                        @ApiParam(name = "limit", value = "每页记录数", required = true)
                        @PathVariable Long limit){

        Page<UndertakeOrg> pageParam = new Page<UndertakeOrg>(page, limit);

        Map<String, Object> map = undertakeOrgService.qryUndertakeOrgInfoActivityPage(pageParam);

        return  R.ok().data(map);
    }
}

